/*==============================================================================
            Copyright (c) 2010-2011 QUALCOMM Incorporated.
            All Rights Reserved.
            Qualcomm Confidential and Proprietary
            
@file 
    CubeShaders.h

@brief
    Defines OpenGL shaders as char* strings.

==============================================================================*/

#ifndef _QCAR_SHADERS_H_
#define _QCAR_SHADERS_H_

#ifndef USE_OPENGL_ES_1_1

///////// TEXTURE SHADER ///////////

static const char* textureVertexShader = " \
  \
attribute vec4 vertexPosition; \
attribute vec4 vertexNormal; \
attribute vec2 vertexTexCoord; \
 \
varying vec2 texCoord; \
varying vec4 normal; \
 \
uniform mat4 modelViewProjectionMatrix; \
 \
void main() \
{ \
   gl_Position = modelViewProjectionMatrix * vertexPosition; \
   normal = vertexNormal; \
   texCoord = vertexTexCoord; \
} \
";


static const char* textureFragmentShader = " \
 \
precision mediump float; \
 \
varying vec2 texCoord; \
varying vec4 normal; \
 \
uniform sampler2D texSampler2D; \
 \
void main() \
{ \
    gl_FragColor = texture2D(texSampler2D, texCoord); \
	/*gl_FragColor = vec4(1.0,1.0,0.0,1.0);*/ \
} \
";

/////////// COLOR SHADER /////////////////

static const char* colorVertexShader = " \
  \
attribute vec4 vertexPosition; \
attribute vec4 vertexNormal; \
attribute vec4 vertexColor; \
varying vec4 color; \
 \
varying vec4 normal; \
 \
uniform mat4 modelViewProjectionMatrix; \
 \
void main() \
{ \
   gl_Position = modelViewProjectionMatrix * vertexPosition; \
   normal = vertexNormal; \
   color = vertexColor; \
} \
";

static const char* colorFragmentShader = " \
 \
precision mediump float; \
 \
varying vec4 normal; \
varying vec4 color;	\
 \
void main() \
{ \
	gl_FragColor = color; \
} \
";

#endif

#endif // _QCAR_SHADERS_H_
